﻿//#define LOG
//#define PRINT

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;

namespace LimitOrderBookSim.Commons
{
    public enum TYPE
    {
        BID,
        ASK
    }

    public enum EVENT
    {
        SUBMISSION,
        CANCELLATION
    }


    public class Writer
    {
        private Object writerLock = new Object();
        private StreamWriter writer;

        public Writer(String file)
        {
            #if LOG
            writer = new StreamWriter(file, true);
            #endif
        }

        public void Write(String text)
        {
            #if LOG
                Monitor.Enter(writer);
                writer.Write(text);
                Monitor.Exit(writer);
            #endif

            #if PRINT
            Console.WriteLine(text);
            #endif
        }
    }

}
